/*
 * by cansik / Florian
 * Datum: 06.05.2010
 * Zeit: 09:51
 * 
 *
 */
using System;

namespace PixelReplacer
{
	/// <summary>
	/// A Pixel Range declares the Filter Range
	/// </summary>
	public class PixelRange
	{
        /// <summary>
        /// Lower Range Boud
        /// </summary>
		public int Lower{get; set;}
        /// <summary>
        /// Upper Range Bound
        /// </summary>
		public int Upper{get; set;}
		
        /// <summary>
        /// A Pixel Range declares the Filter Range
        /// </summary>
		public PixelRange()
		{
			this.Lower = 0;
			this.Upper = 256;
		}
		
        /// <summary>
        /// A Pixel Range declares the Filter Range
        /// </summary>
        /// <param name="Lower">Lower Range Boud</param>
        /// <param name="Upper">Upper Range Bound</param>
		public PixelRange(int Lower, int Upper)
		{
			this.Lower = Lower;
			this.Upper = Upper;
		}
		
        /// <summary>
        /// Checks if the value is between the lower and upper bound
        /// </summary>
        /// <param name="value">Value to Check</param>
        /// <returns>True, if the value is between the bounds</returns>
		public bool IsBetween(int value)
		{
			return (Lower <= value && value < Upper);
		}

        public override string ToString()
        {
            return this.Lower.ToString() + ", " + this.Upper.ToString();
        }
	}
}
